<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="/struts-tags" prefix="s"%>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html>
<html lang="zh-cn">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport"
			content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<meta name="renderer" content="webkit">
		<title>后台管理</title>

		<script type="text/javascript">
		$(function(){
			$("#zhuangxiu").addClass("active");
			$("#zhuangxiu").find("ul li").eq(0).addClass("active");
			})
	</script>
		
	</head>

	<body>

		<div class="admin">
			<div class="panel">
				<div class="panel-head">
					banner管理
				</div>

				<div class="panel-body">
					<table class="table table-hover">
						<tr>
							<th width="200">
								图片
							</th>
							<th width="300">
								排列顺序
							</th>
							<th width="300">
								修改文件
							</th>
							<th width="300">
								修改链接
							</th>
							<th width="400">
								操作
							</th>
						</tr>

						<s:iterator value="banners">
							<tr>
							<form action="banner!update.action" method="post"
								enctype="multipart/form-data">
								<input type="hidden" value="<s:property value="id"/>"
									name="banner.id" />

								<td>
									<%=request.getContextPath()%>
									<img height="70" width="100"
										src="<%=basePath%><s:property value="img"/>" />
								</td>
								<td>
									<input type="text" class="input" name="banner.orderid"
										value="<s:property value="orderid"/>" />
								</td>

								<td>
									<div class="field">
										<a class="button input-file" href="javascript:void(0);">+
											修改图片<input size="100" type="file" name="file"
												data-validate="required:请选择上传文件,regexp#.+.(jpg|jpeg|png|gif)$:只能上传jpg|gif|png格式文件" />
										</a>
									</div>
								</td>
								<td>
									<input name="banner.link" type="text" class="input"
										value="<s:property value="link"/>" />
								</td>
								<td>
									<button type="submit" class="button button-small bg-blue">
										提交
									</button>
									<a
										href="banner!delete.action?banner.id=<s:property value="id"/>">
										<button type="button" class="button button-small bg-green">
											删除
										</button>
									</a>
								</td>
							</tr>
							</form>
							</tr>
						</s:iterator>


					</table>
				</div>
			</div>
		</div>

	</body>
</html>